package com.zerosoft.boilerpanel;

import com.zerosoft.boilerpanel.component.PilotLamp;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.control.Label;
import javafx.scene.layout.VBox;

import java.net.URL;
import java.util.ResourceBundle;

public class HelloController implements Initializable {
    @FXML
    public ImageLabelController ledc;
    @FXML
    public PilotLamp pilot;
    @FXML
    private ImageLabelController led;

    @FXML
    private Label welcomeText;

    public ImageLabelController getLed() {
        return led;
    }

    @FXML
    protected void onHelloButtonClick() {
        welcomeText.setText("Welcome to JavaFX Application!");
        pilot.blink();
//        ledc.blindImage(1000);
//        FXMLLoader fxmlLoader = new FXMLLoader(HelloApplication.class.getResource("image-label.fxml"));
//        fxmlLoader.load();
//        alarm = fxmlLoader.getController();
//        led = new ImageLabelView("https://t7.baidu.com/it/u=429284177,2490231864&fm=193","somethins");
//        led.setLabel("Hello");
//        led.setImageUrl("https://t7.baidu.com/it/u=429284177,2490231864&fm=193");
//        led.blindImage(1000);
    }

    @Override
    public void initialize(URL url, ResourceBundle resourceBundle) {
        pilot.setImage("img/red-lamp.png");
//        led.setImageUrl("https://t7.baidu.com/it/u=429284177,2490231864&fm=193");
//        led.setLabelText("Hello");
//        Image image = new Image("https://t7.baidu.com/it/u=429284177,2490231864&fm=193");
//        leddd.setImage(image);
//        led.setImageUrl("https://t7.baidu.com/it/u=429284177,2490231864&fm=193");
//        led.setLabel("Hello");
//        FXMLLoader fxmlLoader = new FXMLLoader(HelloApplication.class.getResource("image-label.fxml"));
//        try {
//            led = fxmlLoader.load();
//            led = new ImageLabelView("https://t7.baidu.com/it/u=429284177,2490231864&fm=193","somethins");
//            led.setImageUrl("https://t7.baidu.com/it/u=429284177,2490231864&fm=193");
//            led.setLabel("Hello");
//        } catch (Exception e) {
//            e.printStackTrace();
//        }
//        led.setImageUrl("https://t7.baidu.com/it/u=429284177,2490231864&fm=193");
//        led.setLabelText("Hello");
    }
}